package com.honglv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.honglv.pojo.entity.Strategy;
import com.honglv.pojo.dto.UpdateStrategyDTO;
import com.honglv.pojo.vo.GetAllStrategiesVO;
import com.honglv.pojo.vo.GetStrategyVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StrategyMapper extends BaseMapper<Strategy> {

    Long like(@Param("id") Long id, @Param("num") Integer num);


    Long getLikeCount(@Param("id") Long id);

    List<GetAllStrategiesVO> getAllStrategies();

    GetStrategyVO getStrategy(@Param("id") Long id);

    List<GetAllStrategiesVO> getTopStrategy();

    List<GetAllStrategiesVO> getStrategiesByAuthorId(@Param("userId") Long userId);

    @Delete("DELETE FROM tb_Strategy WHERE id = #{id}")
    void deleteStrategy(Long id);

    Integer updateStrategy(UpdateStrategyDTO updateStrategyDTO);
}
